﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<mediatheque.Areas.Admin.Models.Book>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	  Liste des livres
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("../Oeuvres/Layout/admin_menu"); %>
    <h2>Liste des livres</h2>

    <% if (ViewData.Count!=0){%>
    <div class="alert alert-success"> <%: ViewData["message"] %>	</div>
   <% }%>
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th>#ID</th>
                <th>Titre</th>
                <th>Auteur</th>
                <th>Date de publication</th>
                <th>Date d'édition</th>
                <th>Nombre de pages</th>
                
            </tr>
        </thead>
        <% foreach (var book in Model.getBooks()) {  %>
        <tr>
            <td><%= book.id%></td>
            <td><%= book.titre%></td>
            <td><%= book.auteur%></td>
            <td><%= book.date_publication%></td>
            <td><%= book.date_edition%></td>
            <td><%= book.nb_pages%></td>
            <td>
                <a href="/Admin/Books/BookInfo/<%= book.id %>" class="btn btn-inverse btn-mini"><i class="icon-info-sign icon-white"></i></a>
                <a href="/Admin/Books/EditBook/<%= book.id %>" class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i></a>
                <a href="/Admin/Books/DeleteBook/<%= book.id %>" class="btn btn-danger btn-mini"><i class="icon-remove icon-white"></i></a>
            </td>
        </tr>
        <% } %>
     </table>

</asp:Content>
